package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @param
 * @return
 */
@Api(tags = "小程序接口")
@RestController
@RequestMapping("/customer/orders/project")
public class CustomerResultPage extends BaseController {
    @Autowired
    private NursingProjectService nursingProjectService;

    //小程序分页查询
    @GetMapping("/page")
    @ApiOperation(value = "小程序分页查询")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "护理项名称", name = "name", dataType = "string"),
            @ApiImplicitParam(value = "启用状态", name = "status", dataType = "string"),
            @ApiImplicitParam(value = "页码", name = "pageNum", required = true, dataType = "int"),
            @ApiImplicitParam(value = "每页显示条数", name = "pageSize", required = true, dataType = "int")})
    public ResponseResult appletNursingProjectPage(String name, Integer pageNum, Integer pageSize, Integer status) {
        PageResponse page = nursingProjectService.selectByPage(name, pageNum, pageSize, status);
        return success(page);
    }

    //小程序查询回想
    @GetMapping("/{id}")
    @ApiOperation(value = "小程序查询回显")
    public ResponseResult appletGetById(@PathVariable Long id) {
        NursingProjectVo nursingProjectVo = nursingProjectService.selectNursingProjectById(id);
        return success(nursingProjectVo);

    }

}
